﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.Reporting.WinForms;
using mmoss.application.classes;

namespace mmoss.application
{
    public partial class frmViewReport : Form
    {
        public frmViewReport()
        {
            InitializeComponent();
        }

        private void frmViewReport_Load(object sender, EventArgs e)
        {
            
            reportViewer1.ProcessingMode =  ProcessingMode.Local;

            //string reportPath = "Reports/HighestSales.rdlc";
            //reportViewer1.LocalReport.LoadReportDefinition(this.GetType().Assembly.GetManifestResourceStream("mmoss.application.Reports.HighestSales.rdlc"));
            /*
            foreach(ReportDataSource l_child in reportViewer1.LocalReport.DataSources)
            {
                reportViewer1.LocalReport.DataSources.Remove(l_child);
            }
             * */
            reportViewer1.LocalReport.DataSources[0].Value = dbConn.db.Patients.Where(p=>p.patientFirstName=="chad");
            /*
            reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("dsFirstName", dbConn.db.Patients.ToList()));
             * */
            //reportViewer1.LocalReport.ReportPath = reportPath;
            reportViewer1.LocalReport.Refresh();
            reportViewer1.RefreshReport();
        }

    }
}
